store 0 to pl7,pl8,HL,FL,PL6,PL4,PL5
pl4=0
set colo to w/b
@ 4,1 CLEA TO 23,78
do while pl4=0 .AND. LASTKEY()<>27
   DO BOXT WITH 4,3,"PRINT INVENTORY CONTROL",'N+','BG',.T.,.T.
   DO INVAX
   BR=100
   do while pl5=0
      SET COLOR TO BG/B
      @ 10,1 CLEA TO 23,78
      DO BOX2 WITH 10,3,'PRINT :','YES','NO','GR+','R','W+','N',PL5,.T.,.T.
      if pl5=2 .OR. LASTKEY()=27
         return
      else
         DO BOX2 WITH 15,3,'Is the Printer :','Ready','Not Yet Ready','GR+','R','W+','N',PL6,.T.,.T.
         if pl6=2
            @ 20,26 clea to 20,78
            pl5=0
         else
            DO BOXF WITH  20,32,'Printing ...','GR+','R','GR+*',.T.,.T.
            set console off
            set devi to prin
         ENDIF
      endif
   endDO
enddo
SELE 1
SET EXCLU OFF
GO TOP
do while .not. eof()
   if br>57
      if fl>0
         eject
      else
         fl=1
      endif
      cl=50
      hl=hl+1
      TITLE1=ALLTRIM(AEANAME)+' - '+ALLTRIM(AEACOUN)
      TITLE2=ALLTRIM(AEAADDR)
      @  0, 0 SAY TITLE1
      @  0,109 say 'DATE : '+DTOC(DATE())
      @  1, 0 SAY TITLE2
      @  1,51 say 'INVENTORY CONTROL FORM'
      @  1,109 say 'PAGE : '+ALLTRIM(STR(HL,2,0))
      @  2,0 SAY AEACITY
      @  2,51 SAY '    CENTRAL  STORE'
      IF SHRT='DRUG'
         @ 3,51 SAY '         DRUGS'
      ELSE
         @ 3,51 SAY '   DISPOSABLE ITEMS'
      ENDIF
      @ 4, 0 say repl('=',124)
      @ 5, 0 say 'CODE    NAME'+SPACE(17)+'TYPE'+SPACE(14)+'CONTENT'+SPACE(7)+'BUYING'+SPACE(7)+'SELLING'+SPACE(4)+'MAX     MIN '+SPACE(6)+'PHYSICAL     PHYSICAL'
      @ 6,61  SAY 'UNIT'+SPACE(12)+'UNIT'+SPACE(4)+'LEVEL   LEVEL'+SPACE(5)+'BALANCE         COUNT'
      @ 7,69 SAY 'RATIO'
      @ 7,99 SAY 'B.UNIT  S.UNIT'
      @ 8,0 say repl('-',124)
      br=8
   endif
   br=br+1
   IF SHRT='DRUG'
      DCODE=DRUG_CODE
      DNAME=DRUG_NAME
      DTYPE=DRUG_TYPE
      DQANT=DRUG_QANT
      DUNIT=DRUG_UNIT
   ELSE
      DCODE=DISP_CODE
      DNAME=DISP_NAME
      DTYPE=DISP_TYPE
      DQANT=DISP_QANT
      DUNIT=DISP_UNIT
   ENDIF
   @ BR,0 SAY DCODE+SPACE(3)+DNAME
   @ BR,29 SAY DTYPE
   @ BR,47 SAY ALLTRIM(DQANT)+' '+ALLTRIM(DUNIT)
   @ BR,61 SAY SUBST(BUY_UNIT,1,7)
   @ BR,69 SAY BUY_SELL_R PICT '9,999'
   @ BR,75 SAY SUBS(SELL_UNIT,1,6)
   @ BR,83 SAY ST_MAX     PICT '999,999'
   @ BR,91 SAY ST_REFIL   PICT '999,999'
   @ BR,98 SAY ST_ACT_BUY PICT '999,999'
   @ BR,108 SAY ST_ACT_SEL PICT '9,999'
   @ BR,115 SAY REPL('_',4)
   @ BR,120 SAY REPL('_',4)
   BR=BR+1
   SKIP
ENDDO
EJECT
@ 0,0 SAY CHR(18) PICT 'X'
SET DEVI TO SCREEN
close index
CLOSE DATA
RETURN
